package com.glory.brepda.adapter;

import static com.glory.brepda.activity.mfg.ImageMainActivity.stringtoBitmap;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.github.chrisbanes.photoview.PhotoView;
import com.glory.brepda.R;

import java.util.List;


public class UpImageAdapter extends BaseQuickAdapter<String, BaseViewHolder> {
    private boolean b;
    public UpImageAdapter(@Nullable List<String> data,boolean b) {
        super(R.layout.adapter_up_image, data);
        this.b = b;
    }

    @Override
    protected void convert(BaseViewHolder helper, String s) {
        PhotoView ivImage = helper.getView(R.id.ivImage);
        if (!b){
            helper.addOnLongClickListener(R.id.ivImage);
        }
        ivImage.setImageBitmap(stringtoBitmap(s));
    }
}
